package bufferings.lab.stats;

import java.util.List;
import java.util.logging.Logger;

import org.junit.Test;

import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.FetchOptions;
import com.google.appengine.api.datastore.Query;

public class StatsTest {

  private static final Logger logger =
    Logger.getLogger(StatsTest.class.getName());

  @Test
  public void getKindList() {
    DatastoreService service = DatastoreServiceFactory.getDatastoreService();
    Query query = new Query("__Stat_Kind__");
    List<Entity> list =
      service.prepare(query).asList(FetchOptions.Builder.withOffset(0));
    for (Entity entity : list) {
      logger.info((String)entity.getProperty("kind_name"));
    }
  }

}
